#include <iostream>
#include <string>
#include <clocale>
#include "HashTable.h"

using namespace std;

int main()
{
	setlocale(LC_ALL, "swedish");

	//HashTable<string, int> ht;
	HashTable<string, int> ht(29,5);

	ht.Add(new Node<string, int>("Benny", 10));
	ht.Add(new Node<string, int>("Tommy", 20));
	ht.Add(new Node<string, int>("Thea", 30));
	ht.Add(new Node<string, int>("Benny", 11));
	ht.Add(new Node<string, int>("Holger", 23));

	ht.Add(new Node<string, int>("Anna", 15));
	ht.Add(new Node<string, int>("Bengt", 70));
	ht.Add(new Node<string, int>("Tore", 99));
	ht.Add(new Node<string, int>("Kerstin", 56));
	ht.Add(new Node<string, int>("Helge", 73));

	ht.Print();


	cout << endl << endl;

	Node<string, int> *hittad;
	if ((hittad = ht.search("Tore")) != nullptr)
	{
		cout << "Posten hittad" << endl;
		cout << hittad->key << " : " << hittad->value << endl;
	}
	else
		cout << "Posten finns ej" << endl;

	system("PAUSE");
	return 0;
}